﻿/*************************************************
 * 
 *  框架级
 *  
 *  数据库通用类 - 链接数据库
 * 
 *  create by ternence
 * 
 *  create datetime at 2017-03-17
 *  
 *  西安佳卓信息科技有限公司 ©2017
 * 
 * ***********************************************/
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;

namespace Zor_IDAL
{
    public static class DapperConn
    {
        /// <summary>
        /// 链接数据库
        /// </summary>
        /// <param name="sqlConnectionString">数据库连接字符串</param>
        /// <param name="dbType">数据库类型</param>
        /// <returns></returns>
        public static SqlConnection OpenSqlConnection(string dbType=null)
        {
            string sqlconnection = ConfigurationManager.ConnectionStrings["appwebConnection"].ToString();
            SqlConnection conn;
            if (dbType != null) 
            {
                sqlconnection = ConfigurationManager.ConnectionStrings["taxwebConnection"].ToString();
            }
            conn = new SqlConnection(sqlconnection);
            conn.Open();
            return conn;
        }
    
    }
}
